#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2014 Alexander Pyhalov.  All rights reserved.
# Copyright 2016 Jim Klimov
#

include ../../../make-rules/shared-macros.mk

COMPONENT_NAME= docbook-dtds

COMPONENT_VERSION= 1.0
COMPONENT_REVISION= 2
COMPONENT_SUBVERSION= 30.1
COMPONENT_SUMMARY= SGML and XML document type definitions for DocBook.
COMPONENT_SRC= 3.0-sgml
COMPONENT_ARCHIVE= docbk30.zip
COMPONENT_ARCHIVE_HASH= \
  sha256:ecf71cbe8ddbad7494ff520d5b4edf73a428c0b159178cb0cb619cba685e61c6
COMPONENT_ARCHIVE_URL= \
  http://www.oasis-open.org/docbook/sgml/3.0/$(COMPONENT_ARCHIVE)
COMPONENT_PROJECT_URL = http://www.oasis-open.org/docbook/
UNPACK_ARGS+=-r $(COMPONENT_SRC)

PATCH_EACH_ARCHIVE=1

COMPONENT_SRC_1=    3.1-sgml
COMPONENT_ARCHIVE_1=    docbk31.zip
COMPONENT_ARCHIVE_HASH_1= \
    sha256:20261d2771b9a052abfa3d8fab1aa62be05791a010281c566f9073bf0e644538
COMPONENT_ARCHIVE_URL_1= http://www.oasis-open.org/docbook/sgml/3.1/$(COMPONENT_ARCHIVE_1)
UNPACK_ARGS_1+=-r $(COMPONENT_SRC_1)

COMPONENT_SRC_2= 4.0-sgml
COMPONENT_ARCHIVE_2=    docbk40.zip
COMPONENT_ARCHIVE_HASH_2= \
    sha256:dfef22f109779e4cfaafa27b6d381d975ac05eaafb5b3d4407d7043e310817bb
COMPONENT_ARCHIVE_URL_2= http://www.oasis-open.org/docbook/sgml/4.0/$(COMPONENT_ARCHIVE_2)
UNPACK_ARGS_2+=-r $(COMPONENT_SRC_2)

COMPONENT_SRC_3= 4.1-sgml
COMPONENT_ARCHIVE_3=    docbk41.zip
COMPONENT_ARCHIVE_HASH_3= \
    sha256:deaafcf0a3677692e7ad4412c0e41c1db3e9da6cdcdb3dd32b2cc1f9c97d6311
COMPONENT_ARCHIVE_URL_3= http://www.oasis-open.org/docbook/sgml/4.1/$(COMPONENT_ARCHIVE_3)
UNPACK_ARGS_3+=-r $(COMPONENT_SRC_3)

COMPONENT_SRC_4= 4.1.2-xml
COMPONENT_ARCHIVE_4=   docbkx412.zip 
COMPONENT_ARCHIVE_HASH_4= \
    sha256:30f0644064e0ea71751438251940b1431f46acada814a062870f486c772e7772
COMPONENT_ARCHIVE_URL_4= http://www.oasis-open.org/docbook/xml/4.1.2/$(COMPONENT_ARCHIVE_4)
UNPACK_ARGS_4+=-r $(COMPONENT_SRC_4)

COMPONENT_SRC_5= 4.2-sgml
COMPONENT_ARCHIVE_5=   docbook-4.2.zip
COMPONENT_ARCHIVE_HASH_5= \
    sha256:67ebd2c94b342718c6865d2de60f5d4ff02d77a7e4b0d9e72a48c45f2b2635c3
COMPONENT_ARCHIVE_URL_5= http://www.oasis-open.org/docbook/sgml/4.2/$(COMPONENT_ARCHIVE_5)
UNPACK_ARGS_5+=-r $(COMPONENT_SRC_5)

COMPONENT_SRC_6= 4.2-xml
COMPONENT_ARCHIVE_6=   docbook-xml-4.2.zip
COMPONENT_ARCHIVE_HASH_6= \
    sha256:acc4601e4f97a196076b7e64b368d9248b07c7abf26b34a02cca40eeebe60fa2
COMPONENT_ARCHIVE_URL_6= http://www.oasis-open.org/docbook/xml/4.2/$(COMPONENT_ARCHIVE_6)
UNPACK_ARGS_6+=-r $(COMPONENT_SRC_6)

COMPONENT_SRC_7=4.3-sgml
COMPONENT_ARCHIVE_7=   docbook-4.3.zip
COMPONENT_ARCHIVE_HASH_7= \
    sha256:88f52fab7bd49b2e8f40c525014129c26a5a4b8bbd1494e00387556ec76f95ee
COMPONENT_ARCHIVE_URL_7= http://www.docbook.org/sgml/4.3/$(COMPONENT_ARCHIVE_7)
UNPACK_ARGS_7+=-r $(COMPONENT_SRC_7)

COMPONENT_SRC_8=4.3-xml
COMPONENT_ARCHIVE_8=   docbook-xml-4.3.zip
COMPONENT_ARCHIVE_HASH_8= \
    sha256:23068a94ea6fd484b004c5a73ec36a66aa47ea8f0d6b62cc1695931f5c143464
COMPONENT_ARCHIVE_URL_8= http://www.docbook.org/xml/4.3/$(COMPONENT_ARCHIVE_8)
UNPACK_ARGS_8+=-r $(COMPONENT_SRC_8)

COMPONENT_SRC_9=4.4-sgml
COMPONENT_ARCHIVE_9=   docbook-4.4.zip
COMPONENT_ARCHIVE_HASH_9= \
    sha256:0ac7960409b032c8e517483523ecb92af4e59196a33b3e2c5617daa22b7a8a6c
COMPONENT_ARCHIVE_URL_9= http://www.docbook.org/sgml/4.4/$(COMPONENT_ARCHIVE_9)
UNPACK_ARGS_9+=-r $(COMPONENT_SRC_9)

COMPONENT_SRC_10=4.4-xml
COMPONENT_ARCHIVE_10=   docbook-xml-4.4.zip
COMPONENT_ARCHIVE_HASH_10= \
    sha256:02f159eb88c4254d95e831c51c144b1863b216d909b5ff45743a1ce6f5273090
COMPONENT_ARCHIVE_URL_10= http://www.docbook.org/xml/4.4/$(COMPONENT_ARCHIVE_10)
UNPACK_ARGS_10+=-r $(COMPONENT_SRC_10)

COMPONENT_SRC_11=4.5-sgml
COMPONENT_ARCHIVE_11=   docbook-4.5.zip
COMPONENT_ARCHIVE_HASH_11= \
    sha256:8043e514e80c6c19cb146b5d37937d1305bf3abf9b0097c36df7f70f611cdf43
COMPONENT_ARCHIVE_URL_11= http://www.docbook.org/sgml/4.5/$(COMPONENT_ARCHIVE_11)
UNPACK_ARGS_11+=-r $(COMPONENT_SRC_11)

COMPONENT_SRC_12=4.5-xml
COMPONENT_ARCHIVE_12=   docbook-xml-4.5.zip
COMPONENT_ARCHIVE_HASH_12= \
    sha256:4e4e037a2b83c98c6c94818390d4bdd3f6e10f6ec62dd79188594e26190dc7b4
COMPONENT_ARCHIVE_URL_12= http://www.docbook.org/xml/4.5/$(COMPONENT_ARCHIVE_12)
UNPACK_ARGS_12+=-r $(COMPONENT_SRC_12)

CLEAN_PATHS+=$(COMPONENT_NAME)-$(COMPONENT_VERSION)
CLEAN_PATHS+=$(BUILD_DIR)

COMPONENT_PREP_ACTION= ( $(GSED) -i -e's,\(NAMELEN\ \ *\)44,\1256,' $(COMPONENT_DIR)/*/docbook.dcl )

include $(WS_TOP)/make-rules/prep.mk
include $(WS_TOP)/make-rules/ips.mk

$(BUILD_DIR)/%/.built:  $(SOURCE_DIR)/.prep
	$(RM) -r $(@D) ; $(MKDIR) $(@D)
	$(TOUCH) $@

# install the built source into a prototype area
$(BUILD_DIR)/%/.installed:      $(BUILD_DIR)/%/.built
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-3.0-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/3.0-sgml/*.{dcl,dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-3.0-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/3.0-sgml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-3.0-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-3.1-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/3.1-sgml/*.{dcl,dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-3.1-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/3.1-sgml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-3.1-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.0-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.0-sgml/*.{dcl,dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.0-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.0-sgml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.0-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.1-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.1-sgml/*.{dcl,dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.1-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.1-sgml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.1-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.1.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(INSTALL) $(COMPONENT_DIR)/4.1.2-xml/*.{dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.1.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.1.2-xml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.1.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(INSTALL) $(COMPONENT_DIR)/4.1.2-xml/ent/* $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.1.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.2-sgml/*.{dcl,dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.2-sgml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(INSTALL) $(COMPONENT_DIR)/4.2-xml/*.{dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.2-xml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(INSTALL) $(COMPONENT_DIR)/4.2-xml/ent/* $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.2-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.3-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.3-sgml/*.{dcl,dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.3-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.3-sgml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.3-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.3-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(INSTALL) $(COMPONENT_DIR)/4.3-xml/*.{dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.3-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.3-xml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.3-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(INSTALL) $(COMPONENT_DIR)/4.3-xml/ent/* $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.3-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.4-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.4-sgml/*.{dcl,dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.4-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.4-sgml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.4-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.4-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(INSTALL) $(COMPONENT_DIR)/4.4-xml/*.{dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.4-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.4-xml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.4-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(INSTALL) $(COMPONENT_DIR)/4.4-xml/ent/* $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.4-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.5-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.5-sgml/*.{dcl,dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.5-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.5-sgml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/sgml-dtd-4.5-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(MKDIR) $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.5-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(INSTALL) $(COMPONENT_DIR)/4.5-xml/*.{dtd,mod} $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.5-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)
	$(INSTALL) $(COMPONENT_DIR)/4.5-xml/docbook.cat $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.5-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/catalog
	$(INSTALL) $(COMPONENT_DIR)/4.5-xml/ent/* $(PROTO_DIR)/usr/share/sgml/docbook/xml-dtd-4.5-$(COMPONENT_VERSION)-$(COMPONENT_SUBVERSION)/ent
	$(TOUCH) $@

CONFIGURE_PREFIX= /usr/clang/$(COMPONENT_VERSION)

PATH=/usr/sbin:/usr/bin:/usr/perl5/bin

build: $(BUILD_32)

install: $(INSTALL_32)
